/**

 * @class Extmx.AButton
 * 
 * 
 * @extends Ext.BoxComponent
 * @autor Ing. Josue Hernandez Gomez<br>
 *        joshua@extjs.mx<br>
 *        http://www.joshua.com.mx
 * @fecha septiembre de 2011. DF, M&eacute;xico
 * 
 */
Ext.ns("Extmx.AButton");
Extmx.AButton=Ext.extend(Ext.BoxComponent,{
    text:"Link",
    href:"",
    
    clss:"",
    
    margins : {
        top: 3,
        right: 0,
        bottom: 0,
        left: 0
    },

    initComponent: function (){

        Ext.apply(this,{
            id: 'ahref'+this.id,
            autoEl: {
                tag: 'a',
                cls: this.clss,
                html:this.text,
                style:"cursor:pointer"
            }
        });
        
        Extmx.AButton.superclass.initComponent.apply(this,arguments);
    },
    onRender: function (){
        Extmx.AButton.superclass.onRender.apply(this,arguments);
        
        if(!Ext.isEmpty(this.handler))
            Ext.get(this.id).on("click",this.handler.createDelegate(this.scope || this, [this], false), this.scope || this );
    }
});
Ext.reg("abutton",Extmx.AButton);